home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-07-15 | 2.6 KB | 65 lines | [TEXT/MPS ] |
- {MyTemplate is a programming framework which supplies the usual Macintosh user
- interface. You will have to change the procedures starting with My... according
- to your needs. You will find dummies for these procedures in the unit "Task".
- Change them there.
-
- You will often need support by system functions. You should first look at the
- functions in "StdTools". In most cases you will find a function there which is
- satisfying your needs. If you do not, see Inside Macintosh.
-
- You will rarely want to program a nongeneric response to an event. But if you
- want to, the recommended procedure is: Make a copy of the Generic event handler
- which you find in the unit "Generic". Paste the copy to your "TaskCtl". Rename
- it to something like My... throughout TaskCtl and adopt it to your needs. An
- example for this is given in "Random".
-
- Template main program body. In general, you will not have to change anything.
- tdTools useful subroutines.You call them , but you never have to change them.
- Generic standard control functions. The TaskCtl is calling them. You rarely
- have to change them for special needs
- Task Your program kernel. You have to write it. TaskCtl is calling it.
- TaskCtl the main control procedures.Your rarely have to enhance them.
-
- Comments starting MacApp are only of interest if you are migrating towards MacApp.
- 3.10.1987 gs 4.1 added multifinder support
- 30. 7.1987 gs beta test 4.0. MacApp control structure
- 24. 5.1987 gs 3.1 changed naming for MacApp
- 1. 3.1987 gs 3.0 cleaned up }
-
- PROGRAM MyTemplate;
- {© G. Sawitzki, StatLab Heidelberg 1986-1990}
-
- {For Lightspeed Pascal, you should include
- <curly bracket>$I-<curly bracket>
- to switch off the automatic initialization by Lightspeed Pascal}
-
-
- USES
- MacUnits, { Standard Includes}
- StdTools, Generic,
- { use $U<sourcefile> if unit Task is in file <sourcefile>}
- NetWork,ObjIntf,SchedulerUnit,NetSimGlobal,
- Task,
- { use $U<ctlsourcefile> if unit TaskCtl is in file <ctlsourcefile>}
- TaskCtl; {precompiled units used}
-
- CONST
- TplId = 'Template 4.5';
- callsToMoreMasters = 3; {for emory management optimization}
-
- BEGIN {------------------Main Program-----------------}
- gsInitToolbox(callsToMoreMasters); {initializes Toolbox and globals}
- SetUpTheMenus;
- MyInit(MyFileType); {••• Task initialisation •••}
-
- HandleFinderRequest; {Maybe we should Print/open something,
- because a document was selected together
- with the application.
- MacApp hides this inside the Run method.}
- IF NOT gFinderPrinting THEN
- BEGIN
- DrawMenuBar;
- MainEventLoop; {••• MyTask will be called periodically •••}
- END;
- MyCleanUp; {••• Task termination •••}
- END.